package _14CompositeDesignPattern;

import java.util.ArrayList;
import java.util.List;

public class Folder implements IFile {
    private String name;
    private List<IFile> children;
    public Folder(String name){
        this.name=name;
        children=new ArrayList<>();
    }
    @Override
    public void display() {
        System.out.println(name);
    }

    @Override
    public void add(IFile iFile) {
        children.add(iFile);
    }

    @Override
    public void remove(IFile iFile) {
        children.remove(iFile);
    }

    @Override
    public List<IFile> getChildren() {

        return children;
    }
}
